package com.zany.util.vo;

import com.zany.util.action.ParamKey;



public class AbstractVOSupport implements java.io.Serializable{

	private static final long serialVersionUID = -2713902452301221815L;
	private Integer pageStart;//开始条数
	private Integer pageEnd;//结束条数
	private String pageMessage;
	private Integer endPageNum;//尾页
	private Integer pageNow;//当前页
	
	public String getPageMessage() {
		return pageMessage;
	}
	
	public Boolean getEndPageSts(Integer pageStart,Integer pageTotal){
//		endPageNum = pageTotal/ParamKey.PAGE_COUNT==0?pageTotal/ParamKey.PAGE_COUNT:pageTotal/ParamKey.PAGE_COUNT+1;
		if(pageTotal%ParamKey.PAGE_COUNT==0){
			endPageNum = pageTotal/ParamKey.PAGE_COUNT;
		}else{
			endPageNum = pageTotal/ParamKey.PAGE_COUNT+1;
		}
		pageNow = pageStart/ParamKey.PAGE_COUNT+1;
		if(endPageNum.compareTo(pageNow)==0){
			return true;
		}else{
			return false;
		}
	}
	public void setPageMessage(Integer pageStart){	
		if(pageStart!=1){
			pageStart = pageStart + 1;
		}
		setPageStart(pageStart);
		setPageEnd(pageStart + ParamKey.PAGE_COUNT);
	}

	public Integer getPageStart() {
		return pageStart;
	}

	public void setPageStart(Integer pageStart) {
		this.pageStart = pageStart;
	}

	public Integer getPageEnd() {
		return pageEnd;
	}

	public void setPageEnd(Integer pageEnd) {
		this.pageEnd = pageEnd;
	}
}
